package org.cubikalabs.todolist.model
{
	import com.adobe.cairngorm.CairngormError;
	import com.adobe.cairngorm.CairngormMessageCodes;
	import com.adobe.cairngorm.model.IModelLocator;
	
	import mx.collections.ArrayCollection;
    
    [Bindable]
	public class ModelLocator 
	{
		private static var instance:ModelLocator;
		
        public var todoList:ArrayCollection = new ArrayCollection();

		public function ModelLocator()
		{
			if ( instance != null )
			{
				
				throw new CairngormError( CairngormMessageCodes.SINGLETON_EXCEPTION, "ModelLocator" );
			}
            instance = this;		
		}
		
		
		/**
		 * Returns the Singleton instance of GoalManagerModelLocator
		 */
		public static function getInstance() : ModelLocator
		{
			if (instance == null)
			{
				instance = new ModelLocator();
			}
			return instance;
		}
	}
}
